package cn.study.luckyapp.server;

import cn.study.luckyapp.award.command.AwardAddCmdExe;
import cn.study.luckyapp.award.command.AwardUpdateCmdExe;
import cn.study.luckyapp.award.query.AwardListByParamQueryExe;
import cn.study.luckyclient.api.IAwardService;
import cn.study.luckyclient.dto.AwardAddCmd;
import cn.study.luckyclient.dto.AwardUpdateCmd;
import cn.study.luckyclient.dto.data.AwardVo;
import cn.study.luckyclient.dto.query.AwardListByParamQuery;
import com.baomidou.mybatisplus.core.metadata.IPage;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;
@Service
@AllArgsConstructor
public class AwardServiceImpl implements IAwardService {
    private final AwardAddCmdExe awardAddCmdExe;
    private final AwardUpdateCmdExe awardUpdateCmdExe;
    private final AwardListByParamQueryExe awardListByParamQueryExe;
    @Override
    public AwardVo add(AwardAddCmd cmd) {
        return awardAddCmdExe.execute(cmd);
    }

    @Override
    public AwardVo update(AwardUpdateCmd cmd) {
        return awardUpdateCmdExe.execute(cmd);
    }

    @Override
    public IPage<AwardVo> page(AwardListByParamQuery query) {
        return awardListByParamQueryExe.execute(query);
    }
}
